﻿Imports Licenta3.Common.Framework
Imports Licenta3.Common.Classes
Imports Microsoft.Office.Interop.Word

Public MustInherit Class AnexaClass
    Inherits ObjectBase
    Public Property id As Integer
    Public Property ShortName As String
    Public Property LongName As String
    Private _Autorizat As New TAutorizat
    Public Property Autorizat As TAutorizat
        Get
            Return _Autorizat
        End Get
        Set(value As TAutorizat)
            _Autorizat = value
            OnPropertyChanged("Autorizat")
        End Set
    End Property
    Private _proprietar As New ProprietarClass
    Public Overridable Property proprietar As ProprietarClass
        Get
            Return _proprietar
        End Get
        Set(value As ProprietarClass)
            'MsgBox("inainte " & _proprietar.Nume)
            _proprietar = value
            OnPropertyChanged("proprietar")
            'MsgBox("dupa " & _proprietar.Nume)
        End Set
    End Property
    Private _Imobil As New Imobil
    Public Property Imobil As Imobil
        Get
            Return _Imobil
        End Get
        Set(value As Imobil)
            _Imobil = value
            OnPropertyChanged("Imobil")
        End Set
    End Property
    Private _OCPI As Dictionar.OCPIClass
    Public Property OCPI As Dictionar.OCPIClass
        Get
            Return _OCPI
        End Get
        Set(value As Dictionar.OCPIClass)
            _OCPI = value
            OnPropertyChanged("OCPI")
        End Set
    End Property
    Private _BCPI As Dictionar.OCPIClass.BCPIClass
    Public Property BCPI As Dictionar.OCPIClass.BCPIClass
        Get
            Return _BCPI
        End Get
        Set(value As Dictionar.OCPIClass.BCPIClass)
            _BCPI = value
            OnPropertyChanged("BCPI")
        End Set
    End Property
    Private _NrInregistrare As Integer
    Public Property NrInregistrare As Integer
        Get
            Return _NrInregistrare
        End Get
        Set(value As Integer)
            _NrInregistrare = value
            OnPropertyChanged("NrInregistrare")
        End Set
    End Property
    Private _dataInregistrare As Date = Today
    Public Property dataInregistrare As Date
        Get
            Return _dataInregistrare
        End Get
        Set(value As Date)
            _dataInregistrare = value
            OnPropertyChanged("dataInregistrare")
        End Set
    End Property
    Public MustOverride Sub toWordOrPDF(Optional ByVal format As WdSaveFormat = WdSaveFormat.wdFormatDocumentDefault, Optional printOnly As Boolean = False)

    Public Sub New()
        Autorizat = SetariClass._currentAutorizat
        OCPI = Autorizat.DefaultOCPI
        BCPI = Autorizat.DefaultBCPI
    End Sub
End Class
